package com.ruoyi.daily.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.daily.mapper.XinfengDailyWorkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.daily.domain.XinfengDailyWork;
import com.ruoyi.daily.service.IXinfengDailyWorkService;

/**
 * 日常工作Service业务层处理
 * 
 * @author gyy
 * @date 2025-04-19
 */
@Service
public class XinfengDailyWorkServiceImpl implements IXinfengDailyWorkService 
{
    @Autowired
    private XinfengDailyWorkMapper xinfengDailyWorkMapper;

    /**
     * 查询日常工作
     * 
     * @param id 日常工作主键
     * @return 日常工作
     */
    @Override
    public XinfengDailyWork selectXinfengDailyWorkById(Long id)
    {
        return xinfengDailyWorkMapper.selectXinfengDailyWorkById(id);
    }

    /**
     * 查询日常工作列表
     * 
     * @param xinfengDailyWork 日常工作
     * @return 日常工作
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<XinfengDailyWork> selectXinfengDailyWorkList(XinfengDailyWork xinfengDailyWork)
    {
        return xinfengDailyWorkMapper.selectXinfengDailyWorkList(xinfengDailyWork);
    }

    /**
     * 新增日常工作
     * 
     * @param xinfengDailyWork 日常工作
     * @return 结果
     */
    @Override
    public int insertXinfengDailyWork(XinfengDailyWork xinfengDailyWork)
    {
        xinfengDailyWork.setCreateTime(DateUtils.getNowDate());
        return xinfengDailyWorkMapper.insertXinfengDailyWork(xinfengDailyWork);
    }

    /**
     * 修改日常工作
     * 
     * @param xinfengDailyWork 日常工作
     * @return 结果
     */
    @Override
    public int updateXinfengDailyWork(XinfengDailyWork xinfengDailyWork)
    {
        xinfengDailyWork.setUpdateTime(DateUtils.getNowDate());
        return xinfengDailyWorkMapper.updateXinfengDailyWork(xinfengDailyWork);
    }

    /**
     * 批量删除日常工作
     * 
     * @param ids 需要删除的日常工作主键
     * @return 结果
     */
    @Override
    public int deleteXinfengDailyWorkByIds(Long[] ids)
    {
        return xinfengDailyWorkMapper.deleteXinfengDailyWorkByIds(ids);
    }

    /**
     * 删除日常工作信息
     * 
     * @param id 日常工作主键
     * @return 结果
     */
    @Override
    public int deleteXinfengDailyWorkById(Long id)
    {
        return xinfengDailyWorkMapper.deleteXinfengDailyWorkById(id);
    }
}
